﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Documents;

namespace Hi_Baidu.ListType.DetachImage
{
    class TYPE_DETACH_IMAGE_PACKAGE : IComparable<TYPE_DETACH_IMAGE_PACKAGE>
    {
        private int length;
        /// <summary>
        ///     当前封包片数据长度
        /// </summary>
        public int Length
        {
            get { return length; }
            set { length = value; }
        }

        private int packageId;
        /// <summary>
        ///     当前封包片ID
        /// </summary>
        public int PackageId
        {
            get { return packageId; }
            set { packageId = value; }
        }
        private bool isAck;
        /// <summary>
        ///     回馈标示
        /// </summary>
        public bool IsAck
        {
            get { return isAck; }
            set { isAck = value; }
        }
        private bool isEncrypt;
        /// <summary>
        ///     加密标示
        /// </summary>
        public bool IsEncrypt
        {
            get { return isEncrypt; }
            set { isEncrypt = value; }
        }
        private byte[] content;
        /// <summary>
        ///     封包片数据
        /// </summary>
        public byte[] Content
        {
            get { return content; }
            set { content = value; }
        }

        #region IComparable<TYPE_DETACH_PACKAGE> 成员

        public int CompareTo(TYPE_DETACH_IMAGE_PACKAGE other)
        {
            if (this.packageId > other.packageId)
            {
                return 1;
            }
            else if (this.packageId == other.packageId)
            {
                return 0;
            }
            else
            {
                return -1;
            }
        }

        #endregion
    }
}
